﻿using System;
using MugenInjection.Interface;

namespace MugenInjection.Infrastructure
{
    internal sealed class ParameterContext : IParameterContext
    {
        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="ParameterContext"/> class.
        /// </summary>
        public ParameterContext(IInjector injector, Type injectedType)
        {
            Injector = injector;
            InjectedType = injectedType;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ParameterContext"/> class.
        /// </summary>
        public ParameterContext(IInjector injector)
            : this(injector, null)
        {
        }

        #endregion

        #region IParameterContext Members

        /// <summary>
        /// Gets the specified service type.
        /// </summary>
        public Type InjectedType { get; set; }

        /// <summary>
        /// Gets the specified <see cref="IInjector"/>.
        /// </summary>
        public IInjector Injector { get; set; }

        #endregion
    }
}